<html>
<head>
<title>

<?php
$forumtitle=strip_tags($configarray[0]);

print "$forumtitle$pagetitle";

echo "</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$theme_path/style.css\">";
?>
<script language="javascript">
<!--
function codeinsert(code) {
	document.post.body.value = document.post.body.value + code;
	document.post.body.focus();
}
//-->
</script>

</head>
<body>

<?php

//start header vars
unset($header);
//header logo
if($configarray[34]=="on"){
	$header['logo']="<font size=20>$configarray[0]</font>";
}else{
	$header['logo']="<img border=\"0\" src=\"$theme_imagespath/logo.gif\" alt=\"$configarray[0]\">";
}

//headerbuttons
unset($tplcontent2);

$tplcontent2['buttons']="
<a href=\"index.php\"><img src=\"$theme_imagespath/home.gif\" border=0></a>";

if($login!==1){
	$tplcontent2['buttons'].="<a href=\"register.php\"><img src=\"$theme_imagespath/register.gif\" border=0></a>";
}

if($login==1){
	$tplcontent2['buttons'].="<a href=\"user_edit.php\"><img src=\"$theme_imagespath/profile.gif\" border=0></a>";
}

if($userloggedinarray[15]=="administrator"){
	$tplcontent2['buttons'].="<a href=\"admin_config.php\"><img src=\"$theme_imagespath/admin.gif\" border=0></a>";
}

$header['buttons'].=template('headerbuttonrow',$tplcontent2);

//module buttons
$modulesarray=listdirs("modules");
unset($tplcontent2);

for($n=0;$n<count($modulesarray);$n++){
	include("modules/$modulesarray[$n]/config.php");

		if($moduleconfig['active']!=="no"){
	
			$tplcontent2['buttons'].="<a href=\"modules.php?module=$modulesarray[$n]\"><img src=\"$theme_imagespath/$modulesarray[$n].gif\" border=0></a>";
			
			//create a new row for more buttons
			
			if((($n+1) % 4 == 0)||($n+1)==count($modulesarray)){
				$header['buttons'].=template('headerbuttonrow',$tplcontent2);
				unset($tplcontent2);
			}
	
		}

}
//end header buttons

$header['links']="<a href=\"index.php\">$forumtitle</a>$links";

$header['date']=date($dateformat,(time()+$timeoffsetseconds));

$header['language']=ucfirst($userlanguage);
//end header vars

$header['timeoffset']=$userloggedinarray[23];

echo template("header",$header);

?>
